<template>
  <div>
    <!-- 应当作为背景一直常驻 -->
    云流化测试
  </div>
</template>


<script>
import {Config, PixelStreaming} from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.2';
import {Application, PixelStreamingApplicationStyle} from '@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.2';

export default {
  name: 'PlayerView',
  mounted() {
    const PixelStreamingApplicationStyles = new PixelStreamingApplicationStyle();
    PixelStreamingApplicationStyles.applyStyleSheet();

    // Example of how to set the logger level
    // Logger.SetLoggerVerbosity(10);

    // Create a config object
    const config = new Config(
        {
          useUrlParams: true
        }
    );

    // change init setting
    config.setTextSetting("ss", "ws://192.168.1.12:80")
    config.setFlagEnabled("AutoConnect", true)
    config.setFlagEnabled("HoveringMouse", true)
    config.setFlagEnabled("OfferToReceive", false)

    // Create a Native DOM delegate instance that implements the Delegate interface class
    const stream = new PixelStreaming(config);

    const application = new Application({
      stream,
      onColorModeChanged: (isLightMode) => PixelStreamingApplicationStyles.setColorMode(isLightMode),
    });

    document.body.appendChild(application.rootElement);
  },
  methods: {
    // ...
  }
}
</script>


<style>
/* // 应当在背景充满整个屏幕
//body {
//  width: 100vw;
//  height: 100vh;
//  min-height: -webkit-fill-available;
//  font-family: 'Montserrat';
//  margin: 0;
//} */
</style>